function searchMiddleNode(firstNode, arr) {
  const nodeMap = {};
  arr.forEach((item) => {
    const [addr, value, next] = item.split(' ');
    nodeMap[addr] = {
      value,
      next
    }
  })
  // 找到链表真实长度
  let newLength = 1
  let current = nodeMap[firstNode];
  while(current.next !== '-1') {
    current = nodeMap[current.next];
    newLength++;
  }
  // 找中间结点
  let middleIndex = Math.floor(newLength/2);
  let middleNode = nodeMap[firstNode];
  while(middleIndex--) {
    middleNode = nodeMap[middleNode.next];
  }
  console.log(middleNode.value);
}
// let firstNode = '10000'
// let arr = [
//   '76892 7 12309',
//   '12309 5 -1',
//   '10000 1 76892'
// ]
let firstNode = '00100'
let arr = [
  '000000 4 -1',
  '00100 1 12309',
  '33218 3 000000',
  '12309 2 33218'
]
searchMiddleNode(firstNode, arr)